package gti310.tp3;

import gti310.tp3.parser.ConcreteParser;
import gti310.tp3.solver.ConcreteSolver;
import gti310.tp3.writer.ConcreteWriter;

/**
 * The Application class defines a template method to call the elements to solve
 * the problem Unreal-Networks is facing.
 * 
 * @author Francois Caron <francois.caron.7@ens.etsmtl.ca>
 */
public class Application {

	/**
	 * The Application's entry point.
	 * 
	 * The main method makes a series of calls to find a solution to the
	 * problem. The program awaits two arguments, the complete path to the input
	 * file, and the complete path to the output file.
	 * 
	 * @param args
	 *            The array containing the arguments to the files.
	 */
	public static void main(String args[]) {
		System.out.println("Unreal Networks Solver !");
		ConcreteParser inFile = new ConcreteParser();
		GraphHolder graph = inFile.parse(args[0]);
		ConcreteSolver solver = new ConcreteSolver();
		Solutions solution = (Solutions) solver.solve(graph);
		ConcreteWriter writer = new ConcreteWriter();
		writer.write(args[1], solution);
	}
}
